package com.二进制中的1的个数;

public class Solution {
	public int NumberOf1(int n) {
	       int count=0;
	       
	       boolean flag=true;
	        while(flag){
	            if((n & 1)==1)
	                count++;
	            n=n<<1;
	        }
	        return count;
	    }
	 public int countBitDiff(int m, int n) {
	       int end=m^n;
	    	 
	    	 int find=1;
	    	 int count=0;
	    	 while(find!=0) {
	    		 int x = end&find;
	    		 
	    		 if((end&find)!=0) {
	    			 count++;
	    		 }
	    		 find=find<<1;
	    	 }
	      return count;
	    }
}
